<?php
require_once WEB_ROOT. '/application/library/Bus.php';

class Bus_Group extends Bus {
    
    protected $_name = "groups";
    
    public function deleteItemWithId($id) {
        return $this->delete("idgroups='{$id}'");
    }
    
    public function getItemById($id){
        $Dtos = $this->select(array(
            'fields' => array(),
            'where'  => "idgroups='{$id}'"
        ));
        if(count($Dtos) > 0){
            return $Dtos[0];
        }
        return false;
    }
    
    public function getItemByName($name){
        $Dtos = $this->select(array(
            'where'  => "groups_name='{$name}'"
        ));
        if(count($Dtos) > 0){
            return $Dtos[0];
        }
        return false;
    }
}
?>